import request from "@/utils/http/request";

export const login = async (data: any) => {
  return await request({
    url: "/login",
    method: "post",
    data,
  });
};

export const getUserInfo = async (accessToken: any) => {
  return await request({
    url: "/userInfo",
    method: "get",
    data: {},
  });
};

export const logout = async () => {
  return await request({
    url: "/logout",
    method: "post",
  });
};

export const register = async () => {
  return await request({
    url: "/register",
    method: "post",
  });
};

export const useCaptchaApi = async () => {
  return await request({
    url: "/auth/captcha/get",
    method: "post",
  });
};
